projects
/
project
/
cgi-io.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ab4c347
)
Retry splice() syscall on EINTR
author
Jo-Philipp Wich
<
[email protected]
>
Wed, 8 Sep 2021 19:23:49 +0000
(21:23 +0200)
committer
Jo-Philipp Wich
<
[email protected]
>
Wed, 8 Sep 2021 19:48:35 +0000
(21:48 +0200)
The invoked child process might end before the I/O loop finished outputting
all data. In such a case, the splice() call might fail with -1/EINTR.
Continue looping in such a case.
Signed-off-by: Jo-Philipp Wich <
[email protected]
>
main.c
patch
|
blob
|
history
diff --git
a/main.c
b/main.c
index 95a62b827011ce911967705c21dae5180c5ac70d..e55051e3bd01b16584a40cc15a9e4f28cf351c73 100644
(file)
--- a/
main.c
+++ b/
main.c
@@
-672,7
+672,7
@@
main_backup(int argc, char **argv)
do {
len = splice(fds[0], NULL, 1, NULL, READ_BLOCK, SPLICE_F_MORE);
- } while (len > 0);
+ } while (len > 0
|| (len == -1 && errno == EINTR)
);
waitpid(pid, &status, 0);
@@
-836,7
+836,7
@@
main_exec(int argc, char **argv)
do {
len = splice(fds[0], NULL, 1, NULL, READ_BLOCK, SPLICE_F_MORE);
- } while (len > 0);
+ } while (len > 0
|| (len == -1 && errno == EINTR)
);
waitpid(pid, &status, 0);